home *** CD-ROM | disk | FTP | other *** search
-
-
-
- RRRRWWWWTTTTQQQQuuuueeeeuuuueeee((((3333CCCC++++++++)))) RRRRWWWWTTTTQQQQuuuueeeeuuuueeee((((3333CCCC++++++++))))
-
-
-
- NNNNaaaammmmeeee
- RWTQueue<T,C> - Rogue Wave library class
-
- SSSSyyyynnnnooooppppssssiiiissss
- #include <rw/tqueue.h>
-
-
-
- RWTQueue<T, C> queue;
-
-
-
-
- DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn
- This class represents a parameterized queue. Not only can the type of
- object inserted into the queue be parameterized, but also the
- implementation. Parameter TTTT represents the type of object in the queue,
- either a class or built in type. The class TTTT must have:
- well-defined copy semantics (TTTT::::::::TTTT((((ccccoooonnnnsssstttt TTTT&&&&)))) or equiv.);
-
- well-defined assignment semantics (TTTT::::::::ooooppppeeeerrrraaaattttoooorrrr====((((ccccoooonnnnsssstttt TTTT&&&&)))) or
- equiv.);
-
- any other semantics required by class C.
-
- Parameter CCCC represents the class used for implementation. Useful choices
- are RRRRWWWWTTTTVVVVaaaallllSSSSlllliiiisssstttt<<<<TTTT>>>> or RRRRWWWWTTTTVVVVaaaallllDDDDlllliiiisssstttt<<<<TTTT>>>>. Vectors, such as
- RRRRWWWWTTTTVVVVaaaallllOOOOrrrrddddeeeerrrreeeeddddVVVVeeeeccccttttoooorrrr<<<<TTTT>>>>, can also be used, but tend to be less efficient
- at removing an object from the front of the list.
-
- PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee
- None
-
- EEEExxxxaaaammmmpppplllleeee
- In this example a queue of RRRRWWWWCCCCSSSSttttrrrriiiinnnnggggs, implemented as a singly-linked
- list, is exercised.
-
- #include <rw/tqueue.h>
- #include <rw/cstring.h>
- #include <rw/tvslist.h>
- #include <rw/rstream.h>
- main() {
- RWTQueue<RWCString, RWTValSlist<RWCString> > queue;
- queue.insert("one"); // Type conversion occurs
- queue.insert("two");
- queue.insert("three");
- while (!queue.isEmpty())
- cout << queue.get() << endl;
- return 0;
- }
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- RRRRWWWWTTTTQQQQuuuueeeeuuuueeee((((3333CCCC++++++++)))) RRRRWWWWTTTTQQQQuuuueeeeuuuueeee((((3333CCCC++++++++))))
-
-
-
- PPPPrrrrooooggggrrrraaaammmm oooouuuuttttppppuuuutttt
-
- one
- two
-
- PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
- three
-
-
-
- void
- cccclllleeeeaaaarrrr();
-
-
- Removes all items from the queue.
-
- size_t
- eeeennnnttttrrrriiiieeeessss() const;
-
-
- Returns the number of items in the queue.
-
- T
- ffffiiiirrrrsssstttt() const;
-
-
- Returns, but does not remove, the first item in the queue (the item least
- recently inserted into the queue).
-
- T
- ggggeeeetttt();
-
-
- Returns and removes the first item in the queue (the item least recently
- inserted into the queue).
-
- RWBoolean
- iiiissssEEEEmmmmppppttttyyyy() const;
-
-
- Returns TTTTRRRRUUUUEEEE if there are no items in the queue, otherwise FFFFAAAALLLLSSSSEEEE.
-
- void
- iiiinnnnsssseeeerrrrtttt(T a);
-
-
- Inserts the item aaaa at the end of the queue.
-
- T
- llllaaaasssstttt() const;
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- RRRRWWWWTTTTQQQQuuuueeeeuuuueeee((((3333CCCC++++++++)))) RRRRWWWWTTTTQQQQuuuueeeeuuuueeee((((3333CCCC++++++++))))
-
-
-
- Returns, but does not remove, the last item in the queue (the item most
- recently inserted into the queue).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-